﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PPRecorder
{
    public static class InputBox
    {
        /// <summary>
        /// Standard modal DialogResult method used for simple user input (as a string).
        /// </summary>
        /// <param name="caption">Title for the Input form.</param>
        /// <param name="defaultValue">Default to be displayed in the textbox.</param>
        /// <returns>DialogResult, and updates the value of reference parameter 
        /// defaultValue if the result is DialogResult.OK.</returns>
        public static DialogResult ShowDialog(string caption, ref string AuthorValue, ref string ProfileValue)
        {
            using (InputForm inForm = new InputForm(caption, AuthorValue, ProfileValue))
            {
                if (inForm.ShowDialog() == DialogResult.OK)
                {
                    AuthorValue = inForm.AuthorValue;
                    ProfileValue = inForm.ProfileValue;
                    return DialogResult.OK;
                }
                return DialogResult.Cancel;
            }
        }
    }
}
